<?php

namespace application\model;

use application\model\BaseModel as BaseModel;
use application\entity\db\Administrator;

class AdministratorModel extends BaseModel {

    public function __construct() {
        parent::__construct(Administrator::class);
    }

    /**
     * Chi tiết admin theo email
     * @param type $email
     * @return type
     */
    public function getByEmail($email) {
        $cri = new \core\entity\Criteria();
        $cri->andKey("email")->is($email);
        $query = new \core\entity\Query($cri);
        return $this->ifindOne($query);
    }

}
